package org.spring.springboot.domain;

import java.io.Serializable;

/**
 * @描述:
 * @创建人： liuZhiBo
 * @创建时间：2017/10/2713:35
 * @修改人： liuzhibo
 * @修改时间：2017/10/2713:35
 * @修改备注：
 */
public class User implements Serializable {

    private String name;
    private String gender;
    private String age;
    private String address;
    private String phone;

    private User(Bulider bulider) {
        this.age = bulider.age;
        this.address = bulider.address;
        this.gender = bulider.gender;
        this.name = bulider.name;
        this.phone = bulider.phone;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("User{");
        sb.append("name='").append(name).append('\'');
        sb.append(", gender='").append(gender).append('\'');
        sb.append(", age='").append(age).append('\'');
        sb.append(", address='").append(address).append('\'');
        sb.append(", phone='").append(phone).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public String getAge() {
        return age;
    }

    public String getAddress() {
        return address;
    }

    public String getPhone() {
        return phone;
    }

    public static class Bulider {
        private final String name;
        private final String gender;
        private String age;
        private String address;
        private String phone;

        public Bulider(String name, String gender) {
            this.name = name;
            this.gender = gender;
        }

        public Bulider age(String age) {
            this.age = age;
            return this;
        }

        public Bulider address(String address) {
            this.address = address;
            return this;
        }

        public Bulider phone(String phone) {
            this.phone = phone;
            return this;
        }

        public User build() {
            return new User(this);
        }
    }
}
